<template>
  <view class="content" :style="{'background-color': bgcolor}">
    <view class="content-search" :style="{'border-radius': radius + 'px'}" @tap="handleSearch">
      <uni-icons type="search" size="17"></uni-icons>
      <text class="placeholder">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"search",
    data() {
      return {
        
      };
    },
    props: {
      // 背景颜色
      bgcolor: {
        type: String,
        default: '#C00000'
      },
      // 圆角尺寸
      radius: {
        type: Number,
        default: 18
      }
    },
    methods: {
      handleSearch() {
        // 触发外界通过@tap绑定的事件处理函数
        this.$emit('tap')
      }
    }
  }
</script>

<style lang="scss">
.content {
  height: 100rpx;
  padding: 0 20rpx;
  display: flex;
  align-items: center;
  &-search {
    height: 72rpx;
    background-color: #FFFFFF;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    &-placeholder {
      font-size: 30rpx;
      margin-left: 10rpx;
    }
  }
}
</style>
